﻿using System.Diagnostics.Contracts;

namespace System
{
	[ContractClass(typeof(IObserverContract<>))]
	public interface IObserver<in T>
	{
		void OnError(Exception error);
	}

	[ContractClassFor(typeof(IObserver<>))]
	internal abstract class IObserverContract<T> : IObserver<T>
	{
		public void OnError(Exception error)
		{
			Contract.Requires(error != null, null, "error != null");
		}
	}
}